import { EntityModel } from '@midwayjs/orm';
import {
  Column,
  CreateDateColumn,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@EntityModel('expert_commission') // 可以指定表名，不指定会根据类名自己生成
export class ExpertCommission {
  @PrimaryGeneratedColumn()
  id: number = null;

  @Column()
  order_number: string = null;

  @Column({
    nullable: false,
  })
  product_id: string;

  @Column({
    nullable: false,
  })
  store_name: string;

  @Column({
    nullable: false,
    type: 'date',
  })
  data_date: Date;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  commission: number;

  @CreateDateColumn({ comment: '创建时间', type: 'timestamp' })
  created_at: Date;

  @UpdateDateColumn({ comment: '更新时间', type: 'timestamp' })
  updated_at: Date;
}
